import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;


public class SharedMessageQueue {
	int peerID;
	private BlockingQueue<Message> sharedMsgQueue = new LinkedBlockingQueue<Message>();
	Object dummyObject = new Object();
	
	public synchronized Message deQueue(){
		try{
			return sharedMsgQueue.remove();
		}
		catch (Exception e) {
			// TODO: handle exception
			return null;
		}
	}
	
	public synchronized boolean enQueue(Message m){
		try{
			return sharedMsgQueue.add(m);
		}
		catch (Exception e) {
			// TODO: handle exception
			return false;
		}
	}
}
